package tetris.agent;

import java.util.Arrays;

import tetris.simulator.State;


public class Agent {

	//implement this function to have a working system
	//Inputs:
	//- s is the current state of the board
	//- legalMoves is a nx2 matrix of the n possible actions for the current piece.
	//	An action is the orientation & column to place the current piece
	//Outputs:
	//- index n of the action to execute in legalMoves
	public int chooseAction(State s, int[][] legalMoves) 
	{		
		//print legal actions
//		for (int i=0; i<legalMoves.length; i++){
//			System.out.println(Arrays.toString(legalMoves[i]));
//		}
		//return random action
		return (int)(Math.random()*legalMoves.length);
		

	}
	public int chooseActionUsingLikelihoodGradient(State s, int[][] legalMoves, double[] wt) 
	{		
		ApproxFunction ApxFn = new ApproxFunction();
		
		return ApxFn.softMaxPolicy(s, s.legalMoves(), wt);

	}
	
	
	
}
